<?php

class WebUser extends CWebUser
{
    /*
        public function __get($name)
        {
            if ($this->hasState('__userInfo')) {
                $user = $this->getState('__userInfo',array());
                return $user;
            }

            return parent::__get($name);
        }
    */
    public function login($identity, $duration = 0) {
        $this->setState('userInfo', $identity->account->attributes);
        parent::login($identity, $duration);
    }
}